package cuiyt.designpattern.composite;

/**
 * @author cyt
 * @create 2020-07-20 12:47
 */
public abstract class OrganizationComponent {

    private String name;
    private String des;

    /**
     * 打印信息
     */
    public abstract void print();

    public OrganizationComponent(String name, String des) {
        this.name = name;
        this.des = des;
    }

    protected void add(OrganizationComponent organizationComponent) {

        throw new UnsupportedOperationException();
    }


    protected void remove(OrganizationComponent organizationComponent) {

        throw new UnsupportedOperationException();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    @Override
    public String toString() {
        return "OrganizationComponent{" +
                "name='" + name + '\'' +
                ", des='" + des + '\'' +
                '}';
    }
}
